package Java0304;

import java.util.Scanner;

public class LuckyDog {
    public static void main(String[] args) {

            System.out.println("请输入4位会员号：（查询是否中奖）");
            Scanner input = new Scanner(System.in);
            int customNo = input.nextInt();
            int geiwei = customNo % 10;
            int shiwei = customNo / 10 % 10;
            int baiwei = customNo / 100 % 10;
            int qianwei = customNo / 1000;
            int num = geiwei + shiwei + baiwei + qianwei;
            System.out.println("会员卡号" + customNo + "各位之和：" + num);
            if (num > 16 && num <= 20) {
                System.out.println("会员卡号" + customNo + "的会员，恭喜您中奖了获得餐巾纸一包！");
            } else if (num > 20 && num <= 24) {
                System.out.println("会员卡号" + customNo + "的会员，恭喜您中奖了获得电吹风一部！");
            } else if (num > 24) {
                System.out.println("会员卡号" + customNo + "的会员，恭喜您中奖了获得彩电一台！");
            } else {
                System.out.println("会员卡号" + customNo + "的会员，很遗憾，您未中奖，下次继续努力。");
            }
        }
    }

